"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var core_1 = require('@angular/core');
var core_2 = require('@angular/core');
// 导入了 Angular 2 核心库
var CountClicks = (function () {
    function CountClicks() {
        this.numberOfClicks = 0;
    }
    CountClicks.prototype.onClick = function () {
        console.log("button", "number of clicks:", this.numberOfClicks++);
    };
    __decorate([
        core_2.HostListener('click', ['$event.target'])
    ], CountClicks.prototype, "onClick");
    CountClicks = __decorate([
        core_2.Directive({ selector: 'button[counting]' })
    ], CountClicks);
    return CountClicks;
}());
var AppComponent = (function () {
    function AppComponent() {
    }
    AppComponent = __decorate([
        core_1.Component({
            selector: 'my-app',
            // // 指定了此组件的模板。 它用一种增强的 HTML 形式写成，用来告诉 Angular 如何渲染此组件的视图。
            template: "<h1>My First Angular 2 App</h1> \n  <button counting>\u70B9\u6211\u770B\u8F93\u51FA\u4F1A\u589E\u52A0</button>\n  \n  ",
            directives: [CountClicks]
        })
    ], AppComponent);
    return AppComponent;
}());
exports.AppComponent = AppComponent;
